package gdr.dev;


import com.golden.gamedev.Game;
import com.golden.gamedev.GameLoader;
import gdr.graphics.*;
//import gdr.io.*;
import java.awt.Graphics2D;
import java.awt.Dimension;

/**
 * Classe d'avvio dell'applicazione
 * @author Giorgio Vitale
 *
 */
public class SuperGDR9000 extends Game{
	protected BattleGraphics battle;
	
	
	public void initResources() {
    	setFPS(50);
		RandomGenerator r = new RandomGenerator();
    	battle = r.generateBaseBattleGraphics(this);
    	}

    public void update(long elapsedTime) {
        battle.update(elapsedTime);
    }

    public void render(Graphics2D g) {
        battle.render(g);
    }
	
	
	public static void main(String[] args){
		os.Semaphore s = new os.Semaphore();
        
		GameLoader game = new GameLoader();
        game.setup(new SuperGDR9000(), new Dimension(640,480), false);
        game.start();
        /*B b = new B();
        b.setB(5);
        A a1 = new A();
        a1.setBb(b);
        a1.setA(111);
        A a2 = new A();
        a2.setBb(b);
        a2.setA(222);
        System.out.println(">> "+a1);
        System.out.println(">> "+a2);
        
        XMLwriter<A> r = new XMLwriter<A>();
        r.open("a.txt");
        r.write(a1);
        r.write(a2);
        r.close();
        
        a1 = null;
        b = null;
        a2 = null;
        
        XMLreader<A> rr = new XMLreader<A>();
        rr.open("a.txt");
        System.out.println("> "+rr.read());
        System.out.println("> "+rr.read());
        System.out.println("> "+rr.read());
        System.out.println("> "+rr.read());
        */
	}

}